#ifndef PERMUTATION_H
#define PERMUTATION_H
#include <vector>
using std::vector;

class Permutation; 

class RelatedPermutation
{
public:
	RelatedPermutation(Permutation *perm, int intersection): m_Perm(perm), m_Intersection(intersection) {};
	Permutation *GetPerm() const { return m_Perm; };
	int GetIntersection() const { return m_Intersection; };

private:
	Permutation *m_Perm;
	int m_Intersection;
};

class Permutation
{
public:
	Permutation(unsigned long *permutationList,int wordLen, int groupSize);
	~Permutation(void);
	int CountIntersection(unsigned long* groupB); 
	unsigned long *GetMatrixColumns() const;
	unsigned long *GetMatrixRows() const;
	int GetGroupSize() const; 

private:
	unsigned long* TransposeMatrixBits(const int rowCount, const int colCount) const;
	int m_WordLen; // How long is each binary word - column count
	int m_GroupSize; // How many words are in group
	unsigned long *m_Permutation; // List of unsigned longs that are the binary words
	vector<RelatedPermutation> m_RelatedPerms;
};

#endif
